{include file='public/header'}
<style type="text/css">
	#wrapper {
		width: 100%;
		position: absolute;
		left: 0;
		top:234px;
		overflow: hidden;
		z-index: 1;
		/* 防止本机Windows上的触摸事件 */
		-ms-touch-action: none;
		/* 防止callout tap-hold和文本的选择 */
		-webkit-touch-callout: none;
		-webkit-user-select: none;
		-moz-user-select: none;
		-ms-user-select: none;
		user-select: none;
		/* 防止文本调整取向变化对web应用程序很有用 */
		-webkit-text-size-adjust: none;
		-moz-text-size-adjust: none;
		-ms-text-size-adjust: none;
		-o-text-size-adjust: none;
		text-size-adjust: none;
		height: 300px;
	}
	.pull-loading {
		text-align: center;
		height: 40px;
		line-height: 40px;
		display: flex;
		align-items: center;
		justify-content: center;
		color: #fff;
	}
	.w_section3 .w_3{
		padding-top: 0px !important;
	}
	#scroller ul li {}
	.w_section3 .w_3 .a1 .p2{font-size:14px;}
</style>
<body class="she_body">

<div class="bg_fixed_v10_1"></div>
	<div class="sectionY sectionY_tttt">
		<a href="{:url('User/index')}">
			<img src="__PUBLIC__/home/images/v10_a9.png" alt="" class="a1">
		</a>
		<p class="p1">
			<span class="ppp_title">推广收益</span>
		</p>
		<a href="{:url('Set/popularizecon')}" class="s1">出售</a>
	</div>
	<div class="kong1"></div>
	<div class="w_section1">
		<div class="container2">
			<div class="w_1">
				<div class="f1 clearfix">
					<p class="p1">推广收益</p>
				</div>
				<div class="f2">
					<p class="p1">{$userinfo.pushs}</p>
				</div>
			</div>
		</div>
	</div>

	<div class="w_section2">
		<div class="container2">
			<div class="w_2">
				<p class="p1">推广收益</p>
			</div>
		</div>
	</div>

{if condition="$list eq ''" }
	<div class="w_section5">
		<div class="container2">
			<p class="p1">暂无数据</p>
		</div>
	</div>
{else /}
    <div class="w_section3" id='wrapper'>
		<div class="w_3" id="scroller">
			<ul>
				{foreach $list as $v}
				<li class="clearfix">
					<div class="big clearfix">
						<div class="a1">
							<p class="p1">
								<span class="s1">
									{if condition="$v['isadd'] eq 1"}+{/if}
									{if condition="$v['isadd'] eq 2"}-{/if}
												   {$v.nums}
								</span>
							</p>
							<p class="p2">{$v.info}</p>
						</div>
						<div class="a2">
							<p class="p1">{$v.ctime|date='Y-m-d H:i:s',###}</p>
						</div>
					</div>
				</li>
				{/foreach}
			</ul>
            <div class="pull-loading">上拉加载</div>
		</div>

	</div>
{/if}
</body>
</html>
<script type="text/javascript">
    $(function(){
        var dd = $("#wrapper").offset().top;
        $("#wrapper").css("height",($(window).height()-dd-50));
        $("#wrapper").css("top",dd+20);
    })
</script>


<script type="text/javascript">
    var myscroll = new iScroll("wrapper", {
        onScrollMove: function () { //拉动时
            //上拉加载
            if (this.y < this.maxScrollY) {
                $(".pull-loading").html("释放加载");
                $(".pull-loading").addClass("loading");
            } else {
                $(".pull-loading").html("上拉加载");
                $(".pull-loading").removeClass("loading");
            }
        },
        onScrollEnd: function () { //拉动结束时
            //上拉加载
            if ($(".pull-loading").hasClass('loading')) {
                $(".pull-loading").html("加载中...");
                pullOnLoad();
            }
        }
    });
    //上拉加载函数,ajax
    var num = 1;
    function pullOnLoad() {
        num++;
        $.ajax({
            type:'post',
            url:"{:url('Set/ajaxpopularize')}",
            data:{page:num},
            cache:false,
            dataType:'JSON',
            success:function(data){
                //console.log(data);return;
                if(data.length<=0){
                    $('.pull-loading').html("已加载全部");
                }else{
                    var html = '';
                    for(var i=0;i<data.length;i++){
                        html += '<li class="clearfix">';
						html += '   <div class="big clearfix">';
                        html += '   <div class="a1">';
                        html += '        				<p class="p1">';
                        html += '<span class="s1">';
                        if(data[i]['isadd']==1){
                            html += '+'+data[i]['nums'];
                        }else{
                            html += '-'+data[i]['nums'];
                        }
                        html += ' </span>个</p>';
                        html += '  <p class="p2">'+data[i]['info']+'</p></div>';
                        html += '    <div class="a2"><p class="p1">'+data[i]['ctime'];
                        html += '    </p> ';
                        html += '        		</div>';
						html += '        		</div>';
                    }
                    $("#scroller ul").append(html);
                    $('.pull-loading').html("上拉加载");
                }
				myscroll.refresh();
            }
        });
    }
    pullOnLoad();
</script>
